<include file="Public/header" bdstyle="background:#f2f2f2"/>
<include file="Public/header_back"/>
    <div class="product-wrap product-address">
        <section>
            <span>{$goods_data.act_name}</span>
        </section>
    </div>
    <article class="entrepreneurial-address">
        <div class="address-select flex-justify">
            <span>{$goods_data.act_name}</span>
            <a href="javascript:void(0)">上海</a>
        </div>
        <div class="entrepreneurial-label">
            <foreach name="keywords" item="val">
            <span>{$val}</span>
            </foreach>
        </div>
        <div class="flex-justify entrepreneurial-price">
            <span><i>￥</i><font name="goods_price">{$goods_data.ext_info.package_price|default='0'}</font></span>
            <span>最终价格以订单为准</span>
        </div>
    </article>
    <section class="service-case clearfix">
        <span>增值服务</span>
        <span>{$package_detail}</span>
    </section>
    <form id="dataForm">
       <input type="hidden" name="goods_id" value="{$goods_data.act_id}"/>
   	   <input type="hidden" name="is_package" value="1"/>
	    <!-- 企业设立套餐 -->
	    <if condition="in_array($goods_data['act_id'],C('SET_PACKAGE'))">
	    <script>
	    	$(function(){
	    		$('input[name=is_jinchukou]').click(function(){
	    			var price = parseInt('{$goods_data.ext_info.package_price}');
	    			if($(this).val() == '1'){
	    				$('*[name=goods_price]').html(price+2000);
	    			}else{
	    				$('*[name=goods_price]').html(price);
	    			}
	    		})
	    	})
	    </script>
	    <article class="service-select service-export">
	        <h3>进出口</h3>
	        <div class="flex import-export">
	            <div>
	                 <input type="radio" checked value="0" name="is_jinchukou">
	                 <span>不含进出口</span>
	            </div>
	            <div>
	                 <input type="radio" value="1" name="is_jinchukou">
	                 <span>含进出口</span>
	            </div>
	        </div>
	        <h3>可选服务<span>(可多选)</span></h3>
	        <!--以下两种选择-->
	        <div class="expect none">敬请期待！</div>
	        <div class="service clearfix">
	            <foreach name="permits" item="val">
	            <div class="service-queue">
	                <span>{$val.goods_name}</span>
	                <span>￥{$val.shop_price|default=0}</span>
	                <input name="permit[]" value="{$val.goods_id}" type="checkbox">
	                <input type="hidden" name="goods_price" value="{$val.shop_price}"/>
	                <img class="none" src="__PUBLIC__/home/images/selected2.png">
	            </div>
	            </foreach>
	        </div>
	    </article>
	    <article class="registered-address">
	      <h3 class="recommend-product-title">注册地址</h3>
	      <div>
	        <input type="radio"/>
	        <span>集中注册：中国(上海)自由贸易试验区富特北路211号302部位368室</span>
	      </div>
	      <a href="javascript:void(0)">自有地址</a>
	    </article>
	    </if>
	    <!-- 企业变更套餐 -->
	    <if condition="$goods_data.act_id eq '10'">
	    <script>
	    	$(function(){
	    		$('input[name=firmprtype]').click(function(){
	    			if($(this).val() == '1'){
	    				$('#total_amount').show();
	    			}else{
	    				$('#total_amount').hide();
	    			}
	    		})
	    	})
	    </script>
	    <article class="service-select service-export">
	        <h3>公司分类</h3>
	        <div class="flex import-export">
	            <div>
	                 <input type="radio" checked name="firmprtype" value="0"/>
	                 <span>内资</span>
	            </div>
	            <div>
	                 <input type="radio" name="firmprtype" value="1"/>
	                 <span>外资</span>
	            </div>
	        </div>
	        <h3>可选服务<span>(可多选)</span></h3>
	        <!--以下两种选择-->
	        <div class="expect none">敬请期待！</div>
	        <div class="service clearfix">
	            <foreach name="permits" item="val">
	            <div class="service-queue">
	                <span>{$val.goods_name}</span>
	                <span>￥{$val.shop_price|default=0}</span>
	                <input name="permit[]" value="{$val.goods_id}" type="checkbox">
	                <input type="hidden" name="goods_price" value="{$val.shop_price}"/>
	                <img class="none" src="__PUBLIC__/home/images/selected2.png">
	            </div>
	            </foreach>
	        </div>
	    </article>
	    <article class="service-select">
	        <h3>选择企业变更的事项</h3>
	        <p><i class="iconfont icon-gantanhao"></i>变更选项可单选、多选或全选。</p>
	        <div class="service clearfix">
	            <div class="change-address">
	                <div>
	                    <span>注册地址变更</span>
	                    <input name="actchange[]" value="注册地址变更" type="checkbox">
	                    <img class="none" src="__PUBLIC__/home/images/selected2.png">
	                </div>
	            </div>
	            <div class="change-address">
	                <div>
	                    <span>经营范围变更</span>
	                    <input name="actchange[]" value="经营范围变更" type="checkbox">
	                    <img class="none" src="__PUBLIC__/home/images/selected2.png">
	                </div>
	            </div>
	            <div class="change-address">
	                <div>
	                    <span>经营期限变更</span>
	                    <input name="actchange[]" value="经营期限变更" type="checkbox">
	                    <img class="none" src="__PUBLIC__/home/images/selected2.png">
	                </div>
	            </div>
	            <div class="change-address">
	                <div>
	                    <span>出资期限变更</span>
	                    <input name="actchange[]" value="出资期限变更" type="checkbox">
	                    <img class="none" src="__PUBLIC__/home/images/selected2.png">
	                </div>
	            </div>
	            <div class="change-address">
	                <div>
	                    <span>注册资本变更</span>
	                    <input name="actchange[]" value="注册资本变更" type="checkbox">
	                    <img class="none" src="__PUBLIC__/home/images/selected2.png">
	                </div>
	            </div>
	            <div class="change-address">
	                <div>
	                    <span>法定代表人、监事、经理变更</span>
	                    <input name="actchange[]" value="法定代表人、监事、经理变更" type="checkbox">
	                    <img class="none" src="__PUBLIC__/home/images/selected2.png">
	                </div>
	            </div>
	            <div class="change-address" style="display:none;" id="total_amount">
	                <div>
	                    <span>投资总额变更</span>
	                    <input name="actchange[]" value="投资总额变更" type="checkbox">
	                    <img class="none" src="__PUBLIC__/home/images/selected2.png">
	                </div>
	            </div>
	        </div>
	    </article>
	    </if>
	    <!-- 企业汇算清缴 -->
	    <if condition="$goods_data.act_id eq '11'">
	    <script>
    	$(function(){
    		$('input[name=spec_value]').click(function(){
    			var price = parseInt('{$goods_data.ext_info.package_price}');
    			if($(this).val() == '2'){
    				$('*[name=goods_price]').html(price+2000);
    			}else{
    				$('*[name=goods_price]').html(price);
    			}
    		})
    	})
	    </script>
	        <article class="service-select service-export">
		        <h3>是否可提供审计报告</h3>
		        <div class="flex presentation import-export">
		            <div>
		                 <input type="radio" checked name="spec_value" value="1">
		                 <span>是</span>
		            </div>
		            <div>
		                 <input type="radio" name="spec_value" value="2">
		                 <span>否</span>
		            </div>
		        </div>
		    </article>
	    </if>
	   <if condition="$group_goods">
		   <article class="recommend">
		      <h3 class="recommend-product-title">推荐组合套餐</h3>
		      <foreach name="group_goods" item="val">
		      <section class="flex-align">
		          <div class="recommend-radio">
		            <input type="checkbox" name="recommend_goods[]" value="{$val.goods_id}"/>
		            <input type="hidden" name="price" value="{$val.goods.shop_price}"/>
		            <i class="iconfont"></i>
		          </div>
		          <div class="flex-1">
		            <div class="package-type flex-align">
		              <div></div>
		              <div class="flex-1 package-type-main">
		                <h3>{$val.goods.goods_name}</h3>
		                <p>{:cut_str(strip_tags(html_entity_decode($val['goods']['goods_desc'])),20)}</p>
		                <if condition="$val.goods.shop_price eq '0'">
		                	<span>免费</span>
		                <else/>
		                	<span><i>￥</i>{$val.goods.shop_price}</span>
		                </if>
		              </div>
		              <div class="line"></div>
		            </div>
		          </div>
		      </section>
			  </foreach>
		   </article>
	   </if>
   </form>
   <article class="product-detail">
      <h3 class="recommend-product-title">产品详情</h3>
      {:html_entity_decode($goods_data['server_desc'])}
   </article>
   <article class="evaluate">
      <h3 class="recommend-product-title">用户评价</h3>
      <if condition="$comments">
	      <foreach name="comments" item="val">
	      <div class="evaluate-list">
	        <div class="flex-justify">
	            <span>{$val.user_name}</span>
	            <span>{:date('Y-m-d H:i:s',$val['add_time'])}</span>
	        </div>
	        <p>{$val.content}</p>
	      </div>
		  </foreach>
	  <else/>
	      <div style="text-align:center;height:1rem;line-height:1rem;color:#888;">暂无评论！</div>
	  </if>
   </article>
   <div class="foot-margin"></div>
   <footer class="flex-align total">
       <div class="flex-1">
           <div>合计 <strong><i>¥</i><span name="goods_price">{$goods_data.ext_info.package_price|default=0}</span></strong></div>
           <p>下单后请至未完成的订单中完善相关重要信息！</p>
       </div>
       <a href="javascript:void(0)" onclick="add_order()">立即下单</a>
   </footer>
<script>
$(function(){
	$("input[name='recommend_goods[]'],*[name=is_jinchukou],*[name=spec_value],*[name='permit[]']").change(function(){
		setPrice();
	})
	
	$(".service-queue").click(function(){
	    if($(this).find("input").prop("checked")){
	        $(this).css("border","1px solid #ffb534");
	    }else{
	        $(this).removeAttr('style');
	    }
	});
})

function setPrice(){
	var price = parseInt('{$goods_data.ext_info.package_price}');
	$("input[name='recommend_goods[]']").each(function(){
		if($(this).prop('checked')){
			price += parseInt($(this).next('input').val());
		}
	});
	if($('*[name=is_jinchukou]:checked').val() == '1'){
		price += 2000;
	}
	if($('*[name=spec_value]:checked').val() == '2'){
		price += 2000;
	}
	$('*[name="permit[]"]').each(function(){
		if($(this).prop('checked')){
			price += parseInt($(this).next('input').val());
		}
	})
	$('*[name=goods_price]').html(price);
}

//添加订单
function add_order(){
 	$.post(
 		"{:U('Order/orderReady')}",
 		$('#dataForm').serializeArray(),
 		function(data){
 			if(data.status == '1'){
 				layer.msg(data.info);
 				setTimeout("location.href='"+data.url+"'",1000);
 			}else{
 				layer.msg(data.info);
 			}
 		}
 	)
 }
</script>
<include file="Public/footer"/>


